package interview.weibo;

/**
 * @author why
 * @data 2021/8/5
 *
 * 两个大数相加  两个String 字符串 里面全是数字   转成Long会超出范围
 */
public class AddAB {
    public static void main(String[] args) {
        String a = "134";
        String b = "223";
        int aLen = a.length();
        int bLen = b.length();
        String sum = "";
        int c = 0;
        while (aLen != 0 || bLen != 0) {
            c = (c + (((a.charAt(aLen - 1) + b.charAt(bLen - 1)) - 96) / 10));
            int temp = (c + (((a.charAt(aLen - 1) + b.charAt(bLen - 1)) - 96) % 10));
            sum = temp + "" + sum;
            bLen--;
            aLen--;
        }
        System.out.println(sum);
    }
}
